package game.border;

import be.kuleuven.cs.som.annotate.Basic;
import be.kuleuven.cs.som.annotate.Raw;

/**
 * A class involving involving if the wall is made of slippery material.
 * 
 * @version     1.0
 * @author      Dries Liebens 
 *   			Loic Vercruysse
 */
public class Wall extends Obstacle{

	/**
	 * Initialize this new wall with material that isn't slippery.
	 *
	 * @effect	| this(false)
	 */
	public Wall() {
		this(false);
	}
	
	/**
	 * Initialize this new wall with given variable if the wall is 
	 * made of slippery material.
	 * 
	 * @param	isMadeOfSlipperyMaterial
	 * 			If the wall is made of slippery material.
	 * @post	| new.isMadeOfSlipperyMaterial == isMadeOfSlipperyMaterial
	 */
	public Wall(boolean isMadeOfSlipperyMaterial) {
		super();
		this.madeOfSlipperyMaterial = isMadeOfSlipperyMaterial;
	}
	
	/**
	 * Returns if this wall is made of slippery material.
	 */
	@Basic @Raw
	public boolean isMadeOfSlipperyMaterial() {
		return madeOfSlipperyMaterial;
	}
	
	/**
	 * Variable referencing if this wall is made of slippery material.
	 */
	private final boolean madeOfSlipperyMaterial;
	
	/**
	 * Checks whether given obstacle is instance of the class Wall.
	 * 
	 * @param	obstacle
	 * 			Obstacle to check.
	 * @return	| if(obstacle == null)
	 * 			|	result = false
	 * @return	| result = (obstacle.getClass() == Wall.class)
	 */
	@Raw
	public static boolean isWall(Obstacle obstacle) {
		if(obstacle == null)
			return false;
		return (obstacle.getClass() == Wall.class);
	}
	
	/**
	 * Makes a copy of this wall
	 * 
	 * @return	| new WallWithDoor(isMadeOfSlipperyMaterial())
	 */
	@Override
	public Wall clone() {
		return new Wall(isMadeOfSlipperyMaterial());
	}
	
	/**
	 * Returns the closeness of Wall.
	 * 
	 * @return	| if(ismadeOfSlipperyMaterial())
	 * 			|	result = 51;
	 * 			| else
	 * 			| 	result = 50
	 */
	@Override
	public int getCloseness(){
		if(isMadeOfSlipperyMaterial())
			return 51;
		return 50;
	}
}
